package shiro.com.service.sys.impl;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import shiro.com.domain.sys.SysUsers;
import shiro.com.mapper.sys.SysUsersMapper;
import shiro.com.service.sys.ISysUsersService;

/**
 * 【请填写功能名称】Service业务层处理
 *
 * @author ruoyi
 * @date 2022-11-06
 */
@Service
public class SysUsersServiceImpl implements ISysUsersService
{
    @Autowired
    private SysUsersMapper sysUsersMapper;

    /**
     * 查询【请填写功能名称】
     *
     * @param sysUserId 【请填写功能名称】主键
     * @return 【请填写功能名称】
     */
    @Override
    public SysUsers selectSysUsersBySysUserId(Long sysUserId)
    {
        return sysUsersMapper.selectSysUsersBySysUserId(sysUserId);
    }

    /**
     * 查询【请填写功能名称】列表
     *
     * @param sysUsers 【请填写功能名称】
     * @return 【请填写功能名称】
     */
    @Override
    public List<SysUsers> selectSysUsersList(SysUsers sysUsers)
    {
        return sysUsersMapper.selectSysUsersList(sysUsers);
    }

    /**
     * 新增【请填写功能名称】
     *
     * @param sysUsers 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int insertSysUsers(SysUsers sysUsers)
    {
        return sysUsersMapper.insertSysUsers(sysUsers);
    }

    /**
     * 修改【请填写功能名称】
     *
     * @param sysUsers 【请填写功能名称】
     * @return 结果
     */
    @Override
    public int updateSysUsers(SysUsers sysUsers)
    {
        return sysUsersMapper.updateSysUsers(sysUsers);
    }

    /**
     * 批量删除【请填写功能名称】
     *
     * @param sysUserIds 需要删除的【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSysUsersBySysUserIds(Long[] sysUserIds)
    {
        return sysUsersMapper.deleteSysUsersBySysUserIds(sysUserIds);
    }

    /**
     * 删除【请填写功能名称】信息
     *
     * @param sysUserId 【请填写功能名称】主键
     * @return 结果
     */
    @Override
    public int deleteSysUsersBySysUserId(Long sysUserId)
    {
        return sysUsersMapper.deleteSysUsersBySysUserId(sysUserId);
    }

    @Override
    public List<Long> selectListId(Map<String, Object> map) {
        return sysUsersMapper.selectListId(map);
    }
    @Override
    public SysUsers  selectById(String  name){
        return sysUsersMapper.selectById(name);
    }

    @Override
    public SysUsers selectByUsername(String username) {
        QueryWrapper<SysUsers> objectQueryWrapper = new QueryWrapper<>();
        objectQueryWrapper.eq("SYS_USER_NAME",username);
        SysUsers sysUsers = sysUsersMapper.selectOne(objectQueryWrapper);
        return sysUsers;
    }
}
